﻿@inject IStringLocalizer<CollapseNormal> Localizer

<Collapse OnCollapseChanged="@OnChanged">
    <CollapseItems>
        <CollapseItem Text="@Localizer["Consistency"]">
            <div>@Localizer["ConsistencyItem1"]</div>
            <div>@Localizer["ConsistencyItem2"]</div>
        </CollapseItem>
        <CollapseItem Text="@Localizer["Feedback"]" IsCollapsed="false">
            <div>@Localizer["FeedbackItem1"]</div>
            <div>@Localizer["FeedbackItem2"]</div>
        </CollapseItem>
        <CollapseItem Text="@Localizer["Efficiency"]">
            <div>@Localizer["EfficiencyItem1"]</div>
            <div>@Localizer["EfficiencyItem2"]</div>
            <div>@Localizer["EfficiencyItem3"]</div>
        </CollapseItem>
        <CollapseItem Text="@Localizer["Controllability"]">
            <div>@Localizer["ControllabilityItem1"]</div>
            <div>@Localizer["ControllabilityItem2"]</div>
        </CollapseItem>
    </CollapseItems>
</Collapse>
<ConsoleLogger @ref="Logger" class="mt-3" />

@code {
    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private Task OnChanged(CollapseItem item)
    {
        Logger.Log($"{item.Text}: {item.IsCollapsed}");
        return Task.CompletedTask;
    }
}
